package com.fjh.feign;

import com.fjh.domain.Basket;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "cart-service")
public interface OrderCartFeign {

    /**
     * 远程调用购物车模块 根据ids拿到购物车集合
     * @param basketIds
     * @return
     */
    @PostMapping("p/shopCart/getBasketListByIds")
    List<Basket> getBasketListByIds(@RequestBody List<Long> basketIds);

    /**
     * 远程调用清空购物车
     * @param allSkuIds
     * @param userId
     */
    @PostMapping("p/shopCart/clearCart")
    void clearCart(@RequestBody List<Long> allSkuIds, @RequestParam String userId);
}
